/*
   Copyright (C) 2008 Yen-Ju Chen <yjchenx gmail>

   This application is free software; you can redistribute it and/or 
   modify it under the terms of the MIT license. See COPYING.

*/

#import "GNUstep.h"
#import "ICCollection.h"

@implementation  ICCollection

- (NSInteger) numberOfItems
{
	return [items count];
}

- (ICItem *) itemAtIndex: (NSInteger) index
{
	return [items objectAtIndex: index];
}

- (NSArray *) allItems
{
	return items;
}

- (void) addItem: (ICItem *) item
{
	[items addObject: item];
}

- (void) removeItem: (ICItem *) item
{
	[items removeObject: item];
}

- (void) removeItemAtIndex: (NSInteger) index
{
	[items removeObjectAtIndex: index];
}


/** override */
- (id) init
{
	self = [super init];
	items = [[NSMutableArray alloc] init];
	return self;
}

- (void) dealloc
{
	DESTROY(title);
	DESTROY(items);
	[super dealloc];
}

/** Accessory */
- (NSString *) title
{
	return title;
}

- (void) setTitle: (NSString *) t
{
	ASSIGN(title, t);
}

@end

